package com.zhuss.idea.processor;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zhuss.bean.vo.idea.idea.DetailIdeaAppendVo;
import com.zhuss.exception.ExceptionCode;
import com.zhuss.exception.WpsException;
import com.zhuss.idea.db.dao.ext.IdeaAppendDao;


/**
 * 查询奇思妙想Append processor
 * @Author: zhushanshuo
 * @Date: 2019/9/24 19:54
 */
@Component("ideaAppendRead")
public class IdeaAppendRead {
	
	@Autowired
	private IdeaAppendDao ideaAppendDao;
	
	
	public List<DetailIdeaAppendVo> listByType(Integer type, Long ideaId, Long creatorId) {
		List<DetailIdeaAppendVo> list = ideaAppendDao.listByType(type, ideaId, creatorId);
		return list;
	}
	
	public DetailIdeaAppendVo getByType(Integer type, Long ideaId, Long creatorId) {
		DetailIdeaAppendVo result = ideaAppendDao.getByType(type, ideaId, creatorId);
		return result;
	}
	
	/**
	 * 奇思妙想Append详情
	 * @param ideaAppendId
	 * @return
	 * @throws WpsException
	 */
	public Object detail(Long ideaAppendId) throws WpsException {
		Object result = ideaAppendDao.detail(ideaAppendId);
		if (result == null) {
			throw new WpsException(ExceptionCode.数据不存在);
		}
		return result;
	}
	
	

}
